package com.hhyx.execl.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hhyx.execl.mapper.BeforeMapper;
import com.hhyx.execl.model.entity.Before;
import com.hhyx.execl.model.entity.SystemMessage;
import com.hhyx.execl.model.params.BeforeParams;
import com.hhyx.execl.model.result.ReturnPage;
import com.hhyx.execl.service.BeforeFileService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author MarkerCCC
 * @date 2019/6/14 - 10:56
 * @email markerccc@163.com
 */
@Service
public class BeforeFileServiceImpl extends
        ServiceImpl<BeforeMapper, Before> implements
        BeforeFileService {

    @Autowired
    private BeforeMapper beforeMapper;

    @Override
    public ReturnPage<Before> pageList(BeforeParams param) {
        Page<SystemMessage> page = new Page(param.getPage(), param.getLimit());
        List<Before> list = beforeMapper.pageList(page, param);
        ReturnPage<Before> rs = new ReturnPage();
        rs.setTotal(page.getTotal());
        rs.setRecords(list);
        return rs;
    }
}
